package com.qzh.QLanguage.ElementAnalyse;

import java.io.*;
import java.util.List;

// 主程序（测试用例）
public class Main {
    public static void main(String[] args) throws IOException {
        // 测试嵌套字符串场景
        String filePath = "C:\\Users\\Administrator\\IdeaProjects\\aistudy\\src\\main\\java\\com\\qzh\\QLanguage\\test\\helloworld.ql";
        BufferedReader br = new BufferedReader(new FileReader(filePath));
        String s1 =  br.readLine();
        String s2 = br.readLine();
        try {
            QLexer lexer = new QLexer(s1);
            List<Token> tokens = lexer.tokenize();
            System.out.println("词法分析结果:");
            tokens.forEach(System.out::println);
        } catch (Exception e){
            e.printStackTrace();
        }

    }
}